home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 027a / vntx.zip / VNTX.PRG < prev   
Text File  |  1991-02-07  |  1KB  |  33 lines

  1. parameters sDbfName, sNtxName
  2.  
  3. /* List the names of any user-defined or extend functions used in your
  4.    index keys and remove the comment "//" */
  5. // external
  6.  
  7. local nResult, nBadRecno
  8. local aResults := { 'Key mismatch', 'Record number out of range' }
  9. local aErrors := { 'Unable to open specified index', ;
  10.                    'Unable to read from specified index', ;
  11.                    'Unable to find specified database', ;
  12.                    'Index key is undefined on the specified database' }
  13.  
  14. * begin
  15.     if ( (sDbfName == NIL) .or. (sNtxName == NIL) )
  16.         ? 'Invalid parameters.  The proper syntax is:'
  17.         ? 'VTNX <database name> <index name>'
  18.         errorlevel(2)
  19.         return
  20.     end
  21.     nResult := corrupted(sDbfName, sNtxName, @nBadRecno)
  22.     if ( nResult > 0 )
  23.         ? aResults[nResult]
  24.         ? 'Offending record number: ' + ltrim(str(nBadRecno))
  25.         errorlevel(1)
  26.     elseif ( nResult < 0 )
  27.         ? aErrors[-nResult]
  28.         errorlevel(2)
  29.     else
  30.         ? 'No problems found'
  31.     end
  32. return
  33.